package moodish.comm;

import static org.junit.Assert.*;

import moodish.comm.ClientSideMessage.Type;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ClientSideTest {
	
	private ClientSide client;
	private String nickname;
	private String payload;
	private Type type;

	@Before
	public void setUp() throws Exception {
		client = new ClientSide(null, null, type.DISCONNECTED);
	}

	@After
	public void tearDown() throws Exception {
		client = null;
	}

	@Test
	public void testClientSide() {
		nickname = "Grupo16";
		payload = null;
		type = null;
	}

	@Test
	public void testGetType() {
		assertEquals(type.DISCONNECTED, client.getType());
	}

	@Test
	public void testGetSendersNickname() {
		assertEquals("server", client.getSendersNickname());
		client = new ClientSide("Grupo16", "Good", Type.MOODISH_MESSAGE);
		assertEquals("Grupo16", client.getSendersNickname());
	}

	@Test
	public void testGetPayload() {
		assertEquals(null, client.getPayload());
	}

}
